package cn.buk.tms.entity.misc;

import jakarta.persistence.*;
import java.util.Date;

/**
 * 角色信息
 * @author yfdai
 */
@Entity
@Table(name = "sys_role", uniqueConstraints = @UniqueConstraint(name = "uk_sys_role", columnNames = {"enterprise_id", "role_code"}))
public class RoleInfo {

    /**
     * 管理员
     */
    public static final String ROLE_ADMIN = "ROLE_ADMIN";
    /**
     * 数据管理员
     */
    public static final String ROLE_DATA_ADMIN = "ROLE_DATA_ADMIN";
    /**
     * 主管
     */
    public static final String ROLE_SUPERVISOR = "ROLE_SUPERVISOR";
    /**
     * 出纳  OP3
     */
    public static final String ROLE_CASHIER = "ROLE_CASHIER";
    /**
     * 出票员 OP2
     */
    public static final String ROLE_TICKETER = "ROLE_TICKETER";
    /**
     * 客服 OP1
     */
    public static final String ROLE_OPERATOR = "ROLE_OPERATOR";
    /**
     * 送票
     */
    public static final String ROLE_DELIVERY = "ROLE_DELIVERY";
    /**
     * 其它
     */
    public static final String ROLE_USER = "ROLE_USER";
    /**
     * 销售员
     */
    public static final String ROLE_SALE_MAN = "ROLE_SALE_MAN";
    /**
     * 企业客户用：部门经理
     */
    public static final String ROLE_MANAGER = "ROLE_MANAGER";
    public static final int ROLE_MANAGER_ID = 10;
    /**
     * 企业客户用：部门差旅审批人
     */
    public static final String ROLE_APPROVER = "ROLE_APPROVER";
    public static final int ROLE_APPROVER_ID = 20;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;


    @Column(name = "enterprise_id")
    private int enterpriseId;

    /**
     * 角色代码：方便系统内容使用，比如USER,ADMIN等
     */
    @Column(name = "role_code", length = 20)
    private String role;

    /**
     * 中文或英文表述的角色名称
     */
    @Column(name = "role_name", length = 50)
    private String roleName;


    @Column(name="create_time", insertable = false, updatable = false)
    private Date createTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(int enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String roleCode) {
        this.role = roleCode;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }
}
